<?php

define('DS', DIRECTORY_SEPARATOR);

spl_autoload_register(function($className){
    
    $className = str_replace('\\', DS, $className);
    //默认去Lib找
    if (false == strpos($className, DS)) {
        $path = dirname(__FILE__) . DS . $className. '.class.php';
    }else{
        $path = WEBROOT . DS . $className. '.class.php';
    }

    if (file_exists($path)) {
        require($path);
    }else{
        return false;
    }
});
